/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb;

import entity.Message;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author psed
 */
@ManagedBean(name = "MessageBean")
@SessionScoped
public class NewJSFManagedBean {

    @EJB
    private MessagesBean messagesBean;
    private List<Message> messages;

    public NewJSFManagedBean() {
    }

    public List<Message> getMessages() {
        messages = messagesBean.retrieve();
        return messages;
    }
}
